<?php if($session->check('Auth.User.id')){?>
<?php if(isset($my_events) && !empty($my_events)){
	foreach ($my_events as $key => $e) {
?>
	<div class="events">
		<h3 class="events-name"><?php echo $this->Html->link($e['Event']['name'],array('controller'=>'events','action'=>'view',$e['Event']['id']))?></h3>
		
		<div class="clr"></div>
		<p class="events-samll-content"><?php echo $e['Event']['small_content']?></p>
		<div class="events-info">
			<span class="comments" style="width: 40%">
				<?php echo count($e['Post']).$this->Html->image(HOST.'/icon_comments.png',array('title'=>__('Comments total',true)))?>
				<?php echo $this->Html->link($this->Html->image(HOST.'/icon_comments_add.png',array('title'=>__('Add Comments',true))),array('controller'=>'events','action'=>'view',$e['Event']['id']),array('escape'=>false))?>
			</span>
			<span class="created" style="width: 60%">
				<?php
					if($e['Event']['status']){ 
						echo $this->Html->link($this->Html->image(HOST.'/icon_event_unlock.png',array('title'=>__('Unlocked Event',true))),array('controller'=>'events','action'=>'active',$e['Event']['id']),array('escape'=>false));
					}else{
						echo $this->Html->link($this->Html->image(HOST.'/icon_event_lock.png',array('title'=>__('Locked Event',true))),array('controller'=>'events','action'=>'active',$e['Event']['id']),array('escape'=>false));								
					}
				?>
				<?php echo $this->Html->image(HOST.'/icon_calendar.png',array('title'=>__('Created',true))).$e['Event']['created']?>
			</span>
			<div class="clr"></div>
		</div>
		<div class="clr"></div>
	</div>
	
<?php }}}else{
	echo sprintf(__('Please %s to add events.',true),$this->Html->link(__('login',true),array('plugin'=>false,'controller'=>'users','action'=>'welcome')));
}?>
